package com.jianganming.mediator;

public class ServiceA implements IService {

    @Override
    public void doAction() {
        System.out.println("A服务调用");
        //从容器中获取到对象，解决了相互依赖问题
        IService serviceB = Registry.getInstance().getObject("serviceB");
        IService serviceC = Registry.getInstance().getObject("serviceC");
        serviceB.submit();
        serviceC.submit();
    }

    @Override
    public void submit() {
        System.out.println("A服务提交");
    }
}
